<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Login page</title>
</head>
<body>

	<c:if test="${ not empty error }">
		Login failed, reason:
		${ sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message }
	</c:if>
	
	<form action="${pageContext.request.contextPath}/login" method="POST">
		<h2>UDD login page</h2>
		<br>
		<input type="text" name="username" required="required" autofocus="autofocus">
		<br>
		<input type="password" name="password" required="required">
		<br>
		<input type="submit" value="Login">
	</form>
	
	<br>
	Not a member?
	<br>
	<a href="${pageContext.request.contextPath}/agents/register">Register as agent</a>
	<br>
	<a href="${pageContext.request.contextPath}/advertisers/register">Register as advertiser</a>
	

</body>
</html>